/* 
 * File:   main.c
 * Author: C15659
 *
 * Created on July 1, 2013, 4:59 PM
 */

#include <stdio.h>
#include <stdlib.h>
#include <xc.h>

#pragma config BOREN=OFF, FOSC=EXTRC, CPD = OFF, DEBUG = OFF
#pragma config WDTE=OFF, PWRTE=OFF, CP=OFF, LVP=OFF
#pragma config WRT=OFF

#define _XTAL_FREQ 4000000


typedef enum {
           STATE_INIT,
           STATE_SETUP,
           STATE_RUN_DHM,
           STATE_RUN_HMS,
           STATE_TIME_OUT,
           STATE_DEBUG
}main_state;




static main_state current_state = STATE_INIT;
/*
 * 
 */
int main(void) {


    while(1){
        switch (current_state){
            case STATE_INIT:
//                periferal_init();
//                set pic #/State
//                  send values do assign as pic 1 2 3
                break;
            case STATE_SETUP:
//                enter programmed numbers
//                check if HRS is 0
//                    current state = DHM
//                else
//                    current state = HMS
//                display time

                break;
            case STATE_RUN_DHM:
//                if hours == 0
//                    current state = HMS
                break;
            case STATE_RUN_HMS:
//                if HRS && MIN && SEC == 0
//                    current state == time out
                break;
            case STATE_TIME_OUT:
//                flash 0's accross the board at 1 second intervals
                break;
            case STATE_DEBUG:
//                may not need. possible to just execute in ISR
//                runs timer2 at full speed
                break;
            default:
                break;

        }

    }


    return 0;
}

static void interrupt isr(){
    

}

